package cn.doitedu.hbase.hbasemr;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class RateBean implements Writable {


    private String uid;
    private int age;
    private String gender;

    private String movieId;
    private String movieName;
    private String style;

    private int rate;


    public void set(String uid, int age, String gender, String movieId, String movieName, String style, int rate) {
        this.uid = uid;
        this.age = age;
        this.gender = gender;
        this.movieId = movieId;
        this.movieName = movieName;
        this.style = style;
        this.rate = rate;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getMovieId() {
        return movieId;
    }

    public void setMovieId(String movieId) {
        this.movieId = movieId;
    }

    public String getMovieName() {
        return movieName;
    }

    public void setMovieName(String movieName) {
        this.movieName = movieName;
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public int getRate() {
        return rate;
    }

    public void setRate(int rate) {
        this.rate = rate;
    }

    @Override
    public void write(DataOutput out) throws IOException {

        out.writeUTF(this.uid);
        out.writeInt(this.age);
        out.writeUTF(this.gender);
        out.writeUTF(this.movieId);
        out.writeUTF(this.movieName);
        out.writeUTF(this.style);
        out.writeInt(this.rate);



    }

    @Override
    public void readFields(DataInput in) throws IOException {


        this.uid = in.readUTF();
        this.age = in.readInt();
        this.gender = in.readUTF();
        this.movieId = in.readUTF();
        this.movieName = in.readUTF();
        this.style = in.readUTF();
        this.rate = in.readInt();


    }


    @Override
    public String toString() {
        return "RateBean{" +
                "uid='" + uid + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", movieId='" + movieId + '\'' +
                ", movieName='" + movieName + '\'' +
                ", style='" + style + '\'' +
                ", rate=" + rate +
                '}';
    }
}
